package w4156.idog.model;

import java.io.Serializable;

public class User implements Serializable {

	/**
	 * 
	 */
	public enum statusType { Ready, MyTurn, Bid, Hit, Stand, Win, Pending, Surrender };
	private static final long serialVersionUID = 8876643034144979439L;

	private Integer objid;

	private String name;

	private String phone;

	private String eMail;

	private String title;

	private String password;

	private String address;

	private String city;

	private String state;

	private String zipcode;

	private String country;

	private statusType status=statusType.MyTurn;                

	private String updatestamp;
	
	private Double money;

	private boolean admin;
	
	private Double bidAmount;
	
	private int cardNumbers;
	
	private long lastActivity;
	
	public boolean isAdmin() {
		return admin;
	}

	public void setAdmin(boolean isAdmin) {
		this.admin = isAdmin;
	}

	public Double getMoney() {
		return money;
	}

	public void setMoney(Double money) {
		this.money = money;
	}

	/** Creates a new instance of User */
	public User() {
		money = 0.0;
		name = "";
		password = "";
		eMail = "";
		title = "";
		address = "";
		city = "";
		zipcode = "";
		country = "";
		admin = false;
	}

	public User(Integer objid) {
		this.objid = objid;
	}

	public User(Integer objid, String name, String password,
			String address1, String city, String zipcode, String country) {
		this();
		this.objid = objid;
		this.name = name;
		this.password = password;
		this.address = address1;
		this.city = city;
		this.zipcode = zipcode;
		this.country = country;
	}

	public Integer getObjid() {
		return this.objid;
	}

	public void setObjid(Integer objid) {
		this.objid = objid;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String firstname) {
		this.name = firstname;
	}

	public String getPhone() {
		return this.phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getEMail() {
		return this.eMail;
	}

	public void setEMail(String eMail) {
		this.eMail = eMail;
	}

	public String getTitle() {
		return this.title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getPassword() {
		return this.password;
	}

	public void setPassword(String salutation) {
		this.password = salutation;
	}

	public String getAddress() {
		return this.address;
	}

	public void setAddress(String address1) {
		this.address = address1;
	}

	public String getCity() {
		return this.city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	public String getState() {
		return this.state;
	}

	public void setState(String state) {
		this.state = state;
	}

	public String getZipcode() {
		return this.zipcode;
	}

	public void setZipcode(String zipcode) {
		this.zipcode = zipcode;
	}

	public String getCountry() {
		return this.country;
	}

	public void setCountry(String country) {
		this.country = country;
	}

	public statusType retrieveStatus() {
		return this.status;
	}

	public void setStatus(statusType gamestatus) {
		this.status = gamestatus;
	}

	public String getUpdatestamp() {
		return this.updatestamp;
	}

	public void setUpdatestamp(String updatestamp) {
		this.updatestamp = updatestamp;
	}

	@Override
	public int hashCode() {
		int hash = 0;
		hash += (this.objid != null ? this.objid.hashCode() : 0);
		return hash;
	}

	@Override
	public boolean equals(Object object) {
		if (object == null || !this.getClass().equals(object.getClass())) {
			return false;
		}
		User other = (User) object;
		if (this.objid != other.objid
				&& (this.objid == null || !this.objid.equals(other.objid)))
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "[objid=" + this.objid+",name="+this.name+" "+"]";
	}

	public void setCardNumbers(int cardNumbers) {
		this.cardNumbers = cardNumbers;
	}

	public int retrieveCardNumbers() {
		return cardNumbers;
	}

	public void setBidAmount(Double bidAmount) {
		this.bidAmount = bidAmount;
	}

	public Double retrieveBidAmount() {
		return bidAmount;
	}
}
